<?php 
    require_once ('../connect.php');
    //接收传递参数
    $username = $_POST['username'];
    $date = $_POST['date'];
    $introduction = $_POST['introduction'];
    //查找用户
    $user_sql = "select u_id from user where username = '$username'";
    $user_result = $con->query($user_sql);
    $user_row = $user_result->fetch_assoc();
    $user_id = $user_row['u_id'];
    //查找对应图片
    $photo_sql = "select photo_id from photo_wall where user_id = $user_id and photo_date = '$date'";
    $photo_result = $con->query($photo_sql);
    $photo_row = $photo_result->fetch_assoc();
    $photo_id = $photo_row['photo_id'];
    //更新修改的照片说明简介
    $modify_save_content = array(
        "photo_instroduction" => $introduction,
        "flag" => 0
        );
    $introduction_sql = "update photo_wall set introduction = '$introduction' where photo_id = $photo_id";
    if($con->query($introduction_sql)){
        echo json_encode($modify_save_content,JSON_UNESCAPED_UNICODE);
    }
    else{
        $modify_save_content['flag'] = 1;
        echo json_encode($modify_save_content,JSON_UNESCAPED_UNICODE);
    }
?>